<!DOCTYPE html>
<html>
<head>
    <title>API</title>
    <meta charset="utf-8">
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    
        <div id="example" class="k-content">
            <div class="configuration">
                <span class="configHead">API Functions</span>
                <span class="configTitle">Get value</span>
                <ul class="options">
                    <li>
                        <button id="get" class="k-button">Get date</button>
                    </li>
                </ul>
                <span class="configTitle">Set value</span>
                <ul class="options">
                    <li>
                        <input id="value" value="10/10/2000" style="float:none; width: 120px;" />
                        <button id="set" class="k-button">Set date</button>
                    </li>
                </ul>
                <span class="configTitle">Navigation</span>
                <ul class="options">
                    <li>
                        <select id="direction" style="vertical-align: top; width: 120px; margin-bottom: 3px;">
                            <option value="up">upper view</option>
                            <option value="down">lower view</option>
                            <option value="past">past</option>
                            <option value="future" selected="selected">future</option>
                        </select>
                        <button id="navigate" class="k-button">Navigate</button>
                    </li>
                </ul>
            </div>
            <div class="reports">
                <div id="calendar" style="width: 243px;"></div>
            </div>

            <script>
                $(document).ready(function() {
                    $("#calendar").kendoCalendar();

                    var calendar = $("#calendar").data("kendoCalendar");
                    calendar.value(new Date());

                    var navigate = function () {
                        var value = $("#direction").val();
                        switch(value) {
                            case "up":
                                calendar.navigateUp();
                                break;
                            case "down":
                                calendar.navigateDown(calendar.value());
                                break;
                            case "past":
                                calendar.navigateToPast();
                                break;
                            default:
                                calendar.navigateToFuture();
                                break;
                        }
                    },
                    setValue = function () {
                        calendar.value($("#value").val());
                    };

                    $("#get").click(function() {
                        alert(calendar.value());
                    });

                    $("#value").kendoDatePicker({
                        change: setValue
                    });

                    $("#set").click(setValue);

                    $("#direction").kendoDropDownList({
                        change: navigate
                    });

                    $("#navigate").click(navigate);
                });
           </script>
       </div>

            <style scoped>
                .reports {
                    width: 265px;
                    height: 247px;
                    padding: 108px 0 0 20px;
                    background: url('../../content/web/calendar/reports.png') transparent no-repeat 0 0;
                    margin: 30px 105px 20px;
                }
                .configuration {
                    height: 390px;
                    width: 200px;
                }
                .configuration .console {
                    background-color: transparent;
                    border: 0;
                    height: 342px;
                    overflow: auto;
                }
            </style>

	
			
</body>
</html>
